package system.base;

import framework.core.*;

/*
	Author    :Arrow
	CreateTime:2009-05-12 09:11:45
*/
public class BillMoneyInputSearchEvent extends SearchEvent
{

	private String m_id = "" ; // all

	private String m_warehouse_code = "" ; // all

	private String m_warehouse_name = "" ; // all

	private String m_product_name = "" ; // all

	private String m_spec = "" ; // all

	private String m_model = "" ; // all

	private String m_unit = "" ; // all

	private double m_count = Value.NULL_DOUBLE ; // all

	private double m_price = Value.NULL_DOUBLE ; // all

	private double m_money = Value.NULL_DOUBLE ; // all

	private String m_provider_name = "" ; // all

	private String m_bill_type = "" ; // all

	private String m_bill_date = "" ; // all

	private String m_create_user_id = "" ; // all

	private String m_create_user = "" ; // all

	private String m_create_time = "" ; // all
	
	private String m_bill_date_start = "";
	private String m_bill_date_end = "";

public BillMoneyInputSearchEvent() 
{
	super();
	
	setOrderField(BillMoneyInput.ID);
		
}



	public String getId()
	{
		return m_id ;
	}
	public void setId(String v)
	{
		m_id = v;
	}

	public String getWarehouseCode()
	{
		return m_warehouse_code ;
	}
	public void setWarehouseCode(String v)
	{
		m_warehouse_code = v;
	}

	public String getWarehouseName()
	{
		return m_warehouse_name ;
	}
	public void setWarehouseName(String v)
	{
		m_warehouse_name = v;
	}

	public String getProductName()
	{
		return m_product_name ;
	}
	public void setProductName(String v)
	{
		m_product_name = v;
	}

	public String getSpec()
	{
		return m_spec ;
	}
	public void setSpec(String v)
	{
		m_spec = v;
	}

	public String getModel()
	{
		return m_model ;
	}
	public void setModel(String v)
	{
		m_model = v;
	}

	public String getUnit()
	{
		return m_unit ;
	}
	public void setUnit(String v)
	{
		m_unit = v;
	}

	public double getCount()
	{
		return m_count ;
	}
	public void setCount(double v)
	{
		m_count = v;
	}

	public double getPrice()
	{
		return m_price ;
	}
	public void setPrice(double v)
	{
		m_price = v;
	}

	public double getMoney()
	{
		return m_money ;
	}
	public void setMoney(double v)
	{
		m_money = v;
	}

	public String getProviderName()
	{
		return m_provider_name ;
	}
	public void setProviderName(String v)
	{
		m_provider_name = v;
	}

	public String getBillType()
	{
		return m_bill_type ;
	}
	public void setBillType(String v)
	{
		m_bill_type = v;
	}

	public String getBillDate()
	{
		return m_bill_date ;
	}
	public void setBillDate(String v)
	{
		m_bill_date = v;
	}

	public String getCreateUserId()
	{
		return m_create_user_id ;
	}
	public void setCreateUserId(String v)
	{
		m_create_user_id = v;
	}

	public String getCreateUser()
	{
		return m_create_user ;
	}
	public void setCreateUser(String v)
	{
		m_create_user = v;
	}

	public String getCreateTime()
	{
		return m_create_time ;
	}
	public void setCreateTime(String v)
	{
		m_create_time = v;
	}
	
	public String getBillDateStart()
    {
        return m_bill_date_start;
    }
    public void setBillDateStart(String v)
    {
        m_bill_date_start = v;
    }
    
    public String getBillDateEnd()
    {
        return m_bill_date_end;
    }
    public void setBillDateEnd(String v)
    {
        m_bill_date_end = v;
    }
		



	public String viewId() throws Exception
	{
		return Value.view(getId());
	}

	public String viewWarehouseCode() throws Exception
	{
		return Value.view(getWarehouseCode());
	}

	public String viewWarehouseName() throws Exception
	{
		return Value.view(getWarehouseName());
	}

	public String viewProductName() throws Exception
	{
		return Value.view(getProductName());
	}

	public String viewSpec() throws Exception
	{
		return Value.view(getSpec());
	}

	public String viewModel() throws Exception
	{
		return Value.view(getModel());
	}

	public String viewUnit() throws Exception
	{
		return Value.view(getUnit());
	}

	public String viewCount() throws Exception
	{
		return Value.view(getCount());
	}

	public String viewPrice() throws Exception
	{
		return Value.view(getPrice());
	}

	public String viewMoney() throws Exception
	{
		return Value.view(getMoney());
	}

	public String viewProviderName() throws Exception
	{
		return Value.view(getProviderName());
	}

	public String viewBillType() throws Exception
	{
		return Value.view(getBillType());
	}

	public String viewBillDate() throws Exception
	{
		return Value.view(getBillDate());
	}

	public String viewCreateUserId() throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser() throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime() throws Exception
	{
		return Value.view(getCreateTime());
	}
	
	public String viewBillDateStart() throws Exception
    {
        return Value.view(getBillDateStart());
    }
	
	public String viewBillDateEnd() throws Exception
    {
        return Value.view(getBillDateEnd());
    }


	public Conditions toConditions() throws Exception
	{
		Conditions c = super.toConditions();

	c.add(getCondition(BillMoneyInput.ID,getId()));

	c.add(getCondition(BillMoneyInput.WAREHOUSE_CODE,getWarehouseCode()));

	c.add(getCondition(BillMoneyInput.WAREHOUSE_NAME,getWarehouseName()));

	c.add(getCondition(BillMoneyInput.PRODUCT_NAME,getProductName()));

	c.add(getCondition(BillMoneyInput.SPEC,getSpec()));

	c.add(getCondition(BillMoneyInput.MODEL,getModel()));

	c.add(getCondition(BillMoneyInput.UNIT,getUnit()));

	c.add(getCondition(BillMoneyInput.COUNT,getCount()));

	c.add(getCondition(BillMoneyInput.PRICE,getPrice()));

	c.add(getCondition(BillMoneyInput.MONEY,getMoney()));

	c.add(getCondition(BillMoneyInput.PROVIDER_NAME,getProviderName()));

	c.add(getCondition(BillMoneyInput.BILL_TYPE,getBillType()));

	c.add(getCondition(BillMoneyInput.BILL_DATE,getBillDate()));

	c.add(getCondition(BillMoneyInput.CREATE_USER_ID,getCreateUserId()));

	c.add(getCondition(BillMoneyInput.CREATE_USER,getCreateUser()));

	c.add(getCondition(BillMoneyInput.CREATE_TIME,getCreateTime()));
	
	if (!getBillDateStart().equalsIgnoreCase("")) {
        c.add(" bill_date >= ?",Conditions.CUSTOM, getBillDateStart());
    }
    
    if (!getBillDateEnd().equalsIgnoreCase("")) {
        c.add(" bill_date <= ?",Conditions.CUSTOM, getBillDateEnd()+" 23:59:59");
    }

			
		return c ;
	}
	
//add by Arrow start

//add by Arrow end
}
